package com.example.logrexample;

import android.os.Bundle;

import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.tabs.TabLayout;

import androidx.viewpager.widget.ViewPager;
import androidx.appcompat.app.AppCompatActivity;


import com.example.logrexample.ui.main.SectionsPagerAdapter;
import com.wzg.logrlibrary.LogR;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        SectionsPagerAdapter sectionsPagerAdapter = new SectionsPagerAdapter(this, getSupportFragmentManager());
        ViewPager viewPager = findViewById(R.id.view_pager);
        viewPager.setAdapter(sectionsPagerAdapter);
        TabLayout tabs = findViewById(R.id.tabs);
        tabs.setupWithViewPager(viewPager);
        FloatingActionButton fab = findViewById(R.id.fab);

        fab.setOnClickListener(view -> Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                .setAction("Action", null).show());





        /*TAG 可以在 Application定义*/
        LogR.logE("哈哈哈，挺好玩的");
//        LogR.logE("LogR","哈哈哈，挺好玩的");
        LogR.logDateE("哈哈哈，挺好玩的");
//        LogR.logDateE("LogR","哈哈哈，挺好玩的");
//        LogR.getInstance().setLogE("TagE",true);
//        LogR.logDateE("哈哈哈，确实挺好玩的");

        String jsonStr = "{\"weatherinfo\":{\"city\":\"北京\",\"cityid\":\"101010100\"," +
                "\"temp\":\"-2\",\"WD\":\"西北风\",\"WS\":\"3级\",\"SD\":\"241%\",\"WSE\":\"3\"," +
                "\"time\":\"10:61\",\"isRadar\":\"1\",\"Radar\":\"JC_RADAR_AZ9010_JB\"}}";

        LogR.logJsonE(jsonStr);
        LogR.logJsonS("logE", jsonStr);


    }


}